import Vue from 'vue'
import VueRouter from "vue-router";
Vue.use(VueRouter)

import layout from '../views/layout.vue'
import article from '../views/article.vue'
import like from '../views/like.vue'
import user from '../views/user.vue'
import collect from '../views/collect.vue'
import articleDetail from '../views/article-detail.vue'


const router = new VueRouter({
  routes: [
    {
      path:'/',
      redirect:'/article'
    },
    {
      path: '/', 
      component: layout,
      children:[
        {path:'/like',component:like},
        {path:'/collect',component:collect},
        {path:'/article',component:article},
        {path:'/user',component:user},
      ]
    },
    {
      path:'/detail/:id',
      component:articleDetail
    }

  ]
})

export default router